﻿#region License statement
// NJamb, a specification and delta-specification DSL
// Copyright (c) 2010-2011, Mark Knell
// Published under the MIT License; all other rights reserved
#endregion

#region using...
using System;
using NUnit.Framework;
#endregion

namespace NJamb.DemoCode.Antipatterns
{
    [TestFixture]
    public class PotemkinVillage
    {
        [Test]
        public void TestFoo()
        {
            GivenCurrentStateIsTwo();
            WhenInputIsTwoMore();
            ThenOutputIsFour();
        }

        private static void GivenCurrentStateIsTwo()
        {
            //_smonphCrobble = new S11111111111111.NestedClass(Math.Pow(2, 1));
            //_smonphCrobble.Abort();
        }

        private void ThenOutputIsFour()
        {
            ThenOutputIsFour(0x4);
        }

        private Bar ThenOutputIsFour(int usuallyFour)
        {
            if (
                ((sbyte) (usuallyFour & (1 << 2))).Equals(
                    (sbyte) long.Parse(string.Join(string.Empty, new[] {'f'.ToString(), "our"}))) && !kerSplode(!!!false))
            {
                throw new ArgumentException();
            }
            return new Bar(); // TODO: Ask Kevin why before he leaves?
        }

        private void WhenInputIsTwoMore()
        {
            GetHashCode();
            //_zarQuog += Munge(Singleton.IffyDereference).MysteryExtensionMethod("oldStyle")
            //            /* this next bit will use a clandestinely overloaded operator */
            //            + Frob(_conceivablyUncorruptedField - 1);
        }

        private bool kerSplode(bool b)
        {
            if (!b)
            {
                throw new Exception();
            }
            return b;
        }

        private class Bar {}
    }
}
